<#assign module="workcar"/>

<@override name="header">
</@override>
<@override name="body">
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					添加新工作路线
			    </div>
			    <div class="panel-body">
			    <form id="submit_form"  style="" action="${ctx}/workcararea/create" class="form-horizontal" method="post">
			    <input type="hidden" id="startPointLng" name="startPointLng" />
		                <input type="hidden" id="startPointLat" name="startPointLat" />
		                <input type="hidden" id="endPointLng" name="endPointLng" />
		                <input type="hidden" id="endPointLat" name="endPointLat" />
    				 <div class="col-sm-6">
		                    	<div class="panel panel-default" style="position:relative;">
									<div class="panel-heading">
										<span>1.在地图中点击右键。 2.选择设为行驶地添加路线</span>
									</div>
								    <div id="allmap" style="z-index: 999; height:500px;">
					        		</div>
					        	</div>
		             </div>
    				  <div class="col-sm-6">
    				    <@shiro.isMainCompany>	
				      		<div class="form-group">
				                <label class="col-sm-4 control-label">所属公司:</label>
				                <div class="col-sm-6">
					                <select class="form-control" id="companyId" >
										<#if companys??>
											<option value="">请选择公司</option>
											<#list companys as company>
												<option value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
											</#list>
										</#if>
									</select>
				                </div>
							 </div>
						</@shiro.isMainCompany>	 
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>城市：</label>
		                    <div class="col-sm-6">
		                    	<input class="form-control" id="city" name="city" type="text" required/>
		                    </div>
		                </div>
		                 <span class="help-block" style="margin-left:230px;">如：'北京市'、'上海市'、'成都市'等。</span>
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>路线名：</label>
		                    <div class="col-sm-6">
		                    	<input class="form-control" id="name" name="name" type="text" required/>
		                    </div>
		                   
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>选择路线：</label>
		                	<div class="col-sm-6" id="list">
		                	     <div>
		                	       <div class="col-sm-10" style="margin-left:-15px;">
					                    <input class="form-control address" onblur="position(this)" index="0" placeholder="添加地点" type="text" id="wayAddress" value="" autocomplete="off"/>
					               </div>
					               <button  type="button" id="add"   class="btn btn-default btn-sm" title="添加">
                                         <span class="glyphicon glyphicon-plus"></span> 
                                    </button>  
                                 </div>    
                                 <p/>
					        </div>
		                </div>
		                
    				  </div>
					</form>
        		</div>
        		<div class="margin:0 auto;">
        		
					   <div class="form-group" >
			                <label class="col-sm-3 control-label"></label>
			                <input type="button" class="btn btn-primary" id="submit" value="保存">
			                <input type="button" class="btn btn-default" id="rollback" onclick="window.location.href = '${ctx}/workcararea/list';" value="返回">
			            </div>
			    
			        </div>   
			</div>
		</div>
	</div>

</@override>
<@override name="footer">
<script src="//api.map.baidu.com/api?v=2.0&ak=AuNk3YS21DSmHEEvIFDf9dbD" type="text/javascript"></script> 
<#--<script src="${ctx}/assets/js/workcararea.js"></script>-->
<script src="${ctx}/assets/js/newworkcararea.js"></script>
<script type="text/javascript">
	window.daijia = {
		ctx:'${ctx}',
		center:'${address?if_exists}',
		edit:false
	};
	$(document).ready(function(){
		
	});
</script>
</@override>
<@extends name="../layout.ftl"/>